.class public abstract Lcom/opongo/android/custom/AbstractPostsListActivity;
.super Landroid/app/ListActivity;
.source "AbstractPostsListActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/opongo/android/custom/AbstractPostsListActivity$UnlockRefresh;,
        Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;
    }
.end annotation


# static fields
.field public static final DEBUG:Z

.field private static final TAG:Ljava/lang/String;


# instance fields
.field protected apiManager:Lcom/opongo/blogapp/manager/APIManager;

.field protected blogType:I

.field private context:Landroid/content/Context;

.field protected dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

.field private downloadOld:Landroid/os/AsyncTask;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/AsyncTask",
            "<",
            "Ljava/lang/Integer;",
            "Ljava/lang/Void;",
            "Landroid/database/Cursor;",
            ">;"
        }
    .end annotation
.end field

.field private footerView:Landroid/view/View;

.field private footerViewLoading:Landroid/view/View;

.field protected lockLoading:Z

.field private lockRefresh:Z

.field protected mAdapter:Lcom/opongo/android/custom/PostListAdapter;

.field protected position:I

.field protected postPage:I

.field protected post_id:I

.field private posts:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/opongo/blogapp/common/Post;",
            ">;"
        }
    .end annotation
.end field

.field protected query:Ljava/lang/String;

.field protected queryLimit:I

.field private receiver:Landroid/content/BroadcastReceiver;

.field private receiver2:Landroid/content/BroadcastReceiver;

.field protected searchString:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 38
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/android/custom/AbstractPostsListActivity;->DEBUG:Z

    .line 39
    const-class v0, Lcom/opongo/android/custom/AbstractPostsListActivity;

    .line 40
    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    .line 39
    sput-object v0, Lcom/opongo/android/custom/AbstractPostsListActivity;->TAG:Ljava/lang/String;

    .line 35
    return-void
.end method

.method public constructor <init>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    const/4 v1, 0x0

    .line 35
    invoke-direct {p0}, Landroid/app/ListActivity;-><init>()V

    .line 46
    iput-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->searchString:Ljava/lang/String;

    .line 47
    const/4 v0, 0x1

    iput v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    .line 57
    const/16 v0, 0x14

    iput v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->queryLimit:I

    .line 59
    iput v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->post_id:I

    .line 60
    iput v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->position:I

    .line 62
    iput-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->context:Landroid/content/Context;

    .line 35
    return-void
.end method

.method static synthetic access$0(Lcom/opongo/android/custom/AbstractPostsListActivity;Ljava/util/ArrayList;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 44
    iput-object p1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->posts:Ljava/util/ArrayList;

    return-void
.end method

.method static synthetic access$1(Lcom/opongo/android/custom/AbstractPostsListActivity;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 44
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->posts:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$2()Ljava/lang/String;
    .locals 1

    .prologue
    .line 39
    sget-object v0, Lcom/opongo/android/custom/AbstractPostsListActivity;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$3(Lcom/opongo/android/custom/AbstractPostsListActivity;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 62
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->context:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$4(Lcom/opongo/android/custom/AbstractPostsListActivity;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 52
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerViewLoading:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$5(Lcom/opongo/android/custom/AbstractPostsListActivity;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 51
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$6(Lcom/opongo/android/custom/AbstractPostsListActivity;Landroid/os/AsyncTask;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 64
    iput-object p1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    return-void
.end method

.method static synthetic access$7(Lcom/opongo/android/custom/AbstractPostsListActivity;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 49
    iput-boolean p1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->lockRefresh:Z

    return-void
.end method

.method private openBookmarks()V
    .locals 2

    .prologue
    .line 415
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/opongo/blogapp/activities/BookmarksListActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 416
    .local v0, intent:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startActivity(Landroid/content/Intent;)V

    .line 417
    return-void
.end method

.method private openCategories()V
    .locals 2

    .prologue
    .line 420
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/opongo/blogapp/activities/CategoryListActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 421
    .local v0, intent:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startActivity(Landroid/content/Intent;)V

    .line 422
    return-void
.end method

.method private openOptions()V
    .locals 3

    .prologue
    .line 409
    new-instance v0, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getBaseContext()Landroid/content/Context;

    move-result-object v1

    .line 410
    const-class v2, Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    .line 409
    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 411
    .local v0, settingsActivity:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startActivity(Landroid/content/Intent;)V

    .line 412
    return-void
.end method

.method private openVoting()V
    .locals 3

    .prologue
    .line 425
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 426
    .local v0, intent:Landroid/content/Intent;
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "market://details?id="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->context:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 427
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startActivity(Landroid/content/Intent;)V

    .line 428
    return-void
.end method


# virtual methods
.method protected doRefresh(Z)V
    .locals 8
    .parameter "forceRefresh"

    .prologue
    const/4 v7, 0x0

    const/4 v6, 0x0

    const/4 v5, 0x1

    .line 381
    iget-boolean v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->lockRefresh:Z

    if-eqz v2, :cond_0

    if-eqz p1, :cond_2

    :cond_0
    iget-boolean v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->lockLoading:Z

    if-nez v2, :cond_2

    .line 382
    iput-boolean v5, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->lockRefresh:Z

    .line 383
    iput-boolean v5, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->lockLoading:Z

    .line 385
    sget-object v2, Lcom/opongo/android/custom/AbstractPostsListActivity;->TAG:Ljava/lang/String;

    const-string v3, "doRefresh"

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 387
    new-instance v1, Ljava/util/Timer;

    invoke-direct {v1}, Ljava/util/Timer;-><init>()V

    .line 389
    .local v1, timer:Ljava/util/Timer;
    new-instance v2, Lcom/opongo/android/custom/AbstractPostsListActivity$UnlockRefresh;

    invoke-direct {v2, p0, v7}, Lcom/opongo/android/custom/AbstractPostsListActivity$UnlockRefresh;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;Lcom/opongo/android/custom/AbstractPostsListActivity$UnlockRefresh;)V

    const-wide/32 v3, 0x493e0

    invoke-virtual {v1, v2, v3, v4}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    .line 391
    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    invoke-virtual {v2}, Lcom/opongo/android/custom/PostListAdapter;->isEmpty()Z

    move-result v2

    if-nez v2, :cond_1

    .line 392
    new-instance v0, Landroid/content/Intent;

    const-string v2, "com.opongo.progressDialog_show"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 393
    .local v0, i:Landroid/content/Intent;
    const-string v2, "MESSAGE"

    const v3, 0x7f070017

    invoke-virtual {p0, v3}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 394
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->sendBroadcast(Landroid/content/Intent;)V

    .line 396
    .end local v0           #i:Landroid/content/Intent;
    :cond_1
    new-instance v2, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;

    invoke-direct {v2, p0, v7}, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;)V

    const/4 v3, 0x3

    new-array v3, v3, [Ljava/lang/Integer;

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v3, v6

    iget v4, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v3, v5

    const/4 v4, 0x2

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    invoke-virtual {v2, v3}, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    move-result-object v2

    iput-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    .line 400
    .end local v1           #timer:Ljava/util/Timer;
    :goto_0
    return-void

    .line 398
    :cond_2
    sget-object v2, Lcom/opongo/android/custom/AbstractPostsListActivity;->TAG:Ljava/lang/String;

    const-string v3, "doRefresh locked"

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 143
    invoke-super {p0, p1}, Landroid/app/ListActivity;->onCreate(Landroid/os/Bundle;)V

    .line 144
    iput-object p0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->context:Landroid/content/Context;

    .line 146
    const-string v0, "layout_inflater"

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 147
    const v1, 0x7f03000b

    invoke-virtual {v0, v1, v3, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    .line 146
    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    .line 148
    const-string v0, "layout_inflater"

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 149
    const v1, 0x7f03000d

    invoke-virtual {v0, v1, v3, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    .line 148
    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerViewLoading:Landroid/view/View;

    .line 150
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getListView()Landroid/widget/ListView;

    move-result-object v0

    iget-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 152
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    new-instance v1, Lcom/opongo/android/custom/AbstractPostsListActivity$4;

    invoke-direct {v1, p0}, Lcom/opongo/android/custom/AbstractPostsListActivity$4;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 159
    new-instance v0, Lcom/opongo/android/custom/AbstractPostsListActivity$5;

    invoke-direct {v0, p0}, Lcom/opongo/android/custom/AbstractPostsListActivity$5;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;)V

    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver:Landroid/content/BroadcastReceiver;

    .line 167
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver:Landroid/content/BroadcastReceiver;

    new-instance v1, Landroid/content/IntentFilter;

    .line 168
    const-string v2, "com.opongo.postsShouldRefresh"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 167
    invoke-virtual {p0, v0, v1}, Lcom/opongo/android/custom/AbstractPostsListActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 170
    new-instance v0, Lcom/opongo/android/custom/AbstractPostsListActivity$6;

    invoke-direct {v0, p0}, Lcom/opongo/android/custom/AbstractPostsListActivity$6;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;)V

    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver2:Landroid/content/BroadcastReceiver;

    .line 185
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;Lcom/opongo/blogapp/manager/DatabaseManager;Ljava/lang/String;ILcom/opongo/blogapp/manager/APIManager;)V
    .locals 9
    .parameter "savedInstanceState"
    .parameter "dbManager"
    .parameter "query"
    .parameter "blogType"
    .parameter "apiManager"

    .prologue
    const/4 v8, 0x0

    const/4 v7, 0x0

    .line 68
    sget-boolean v0, Lcom/opongo/android/custom/AbstractPostsListActivity;->DEBUG:Z

    if-eqz v0, :cond_0

    .line 69
    sget-object v0, Lcom/opongo/android/custom/AbstractPostsListActivity;->TAG:Ljava/lang/String;

    const-string v1, "*** create ***"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 71
    :cond_0
    invoke-super {p0, p1}, Landroid/app/ListActivity;->onCreate(Landroid/os/Bundle;)V

    .line 72
    const v0, 0x7f03000a

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->setContentView(I)V

    .line 74
    iput-object p0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->context:Landroid/content/Context;

    .line 76
    iput-object p2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    .line 77
    iput-object p3, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->query:Ljava/lang/String;

    .line 78
    iput p4, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->blogType:I

    .line 80
    if-eqz p5, :cond_2

    .line 81
    iput-object p5, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->apiManager:Lcom/opongo/blogapp/manager/APIManager;

    .line 86
    :goto_0
    invoke-virtual {p2, p3}, Lcom/opongo/blogapp/manager/DatabaseManager;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v4

    .line 87
    .local v4, cursor:Landroid/database/Cursor;
    invoke-virtual {p0, v4}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startManagingCursor(Landroid/database/Cursor;)V

    .line 89
    invoke-interface {v4}, Landroid/database/Cursor;->getCount()I

    move-result v0

    div-int/lit8 v0, v0, 0x14

    int-to-double v0, v0

    invoke-static {v0, v1}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v0

    double-to-int v0, v0

    iput v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    .line 91
    iget v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    if-nez v0, :cond_1

    .line 92
    const/4 v0, 0x1

    iput v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    .line 94
    :cond_1
    iget v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    mul-int/lit8 v0, v0, 0x14

    iput v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->queryLimit:I

    .line 96
    new-instance v0, Lcom/opongo/android/custom/PostListAdapter;

    const v3, 0x7f03000f

    .line 97
    invoke-virtual {p2}, Lcom/opongo/blogapp/manager/DatabaseManager;->getTableName()Ljava/lang/String;

    move-result-object v5

    move-object v1, p0

    move-object v2, p0

    move-object v6, p2

    invoke-direct/range {v0 .. v6}, Lcom/opongo/android/custom/PostListAdapter;-><init>(Landroid/app/Activity;Landroid/content/Context;ILandroid/database/Cursor;Ljava/lang/String;Lcom/opongo/blogapp/manager/DatabaseManager;)V

    .line 96
    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    .line 99
    const-string v0, "layout_inflater"

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 100
    const v1, 0x7f03000b

    invoke-virtual {v0, v1, v8, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    .line 99
    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    .line 101
    const-string v0, "layout_inflater"

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 102
    const v1, 0x7f03000d

    invoke-virtual {v0, v1, v8, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    .line 101
    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerViewLoading:Landroid/view/View;

    .line 103
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getListView()Landroid/widget/ListView;

    move-result-object v0

    iget-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 105
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    new-instance v1, Lcom/opongo/android/custom/AbstractPostsListActivity$1;

    invoke-direct {v1, p0}, Lcom/opongo/android/custom/AbstractPostsListActivity$1;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 112
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->setListAdapter(Landroid/widget/ListAdapter;)V

    .line 114
    new-instance v0, Lcom/opongo/android/custom/AbstractPostsListActivity$2;

    invoke-direct {v0, p0}, Lcom/opongo/android/custom/AbstractPostsListActivity$2;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;)V

    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver:Landroid/content/BroadcastReceiver;

    .line 122
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver:Landroid/content/BroadcastReceiver;

    new-instance v1, Landroid/content/IntentFilter;

    .line 123
    const-string v2, "com.opongo.postsShouldRefresh"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 122
    invoke-virtual {p0, v0, v1}, Lcom/opongo/android/custom/AbstractPostsListActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 125
    new-instance v0, Lcom/opongo/android/custom/AbstractPostsListActivity$3;

    invoke-direct {v0, p0, p2}, Lcom/opongo/android/custom/AbstractPostsListActivity$3;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;Lcom/opongo/blogapp/manager/DatabaseManager;)V

    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver2:Landroid/content/BroadcastReceiver;

    .line 140
    return-void

    .line 83
    .end local v4           #cursor:Landroid/database/Cursor;
    :cond_2
    new-instance v0, Lcom/opongo/blogapp/manager/APIManager;

    invoke-direct {v0, p0}, Lcom/opongo/blogapp/manager/APIManager;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->apiManager:Lcom/opongo/blogapp/manager/APIManager;

    goto/16 :goto_0
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 2
    .parameter "menu"

    .prologue
    .line 404
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getMenuInflater()Landroid/view/MenuInflater;

    move-result-object v0

    const v1, 0x7f0e0003

    invoke-virtual {v0, v1, p1}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V

    .line 405
    invoke-super {p0, p1}, Landroid/app/ListActivity;->onCreateOptionsMenu(Landroid/view/Menu;)Z

    move-result v0

    return v0
.end method

.method public onDestroy()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 338
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    if-eqz v0, :cond_0

    .line 339
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->cancel(Z)Z

    .line 340
    iput-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    .line 342
    :cond_0
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v0}, Lcom/opongo/blogapp/manager/DatabaseManager;->close()V

    .line 343
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    invoke-virtual {v0}, Lcom/opongo/android/custom/PostListAdapter;->stopImgLoaderThread()V

    .line 344
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->receiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 346
    invoke-virtual {p0, v2}, Lcom/opongo/android/custom/AbstractPostsListActivity;->setListAdapter(Landroid/widget/ListAdapter;)V

    .line 347
    invoke-super {p0}, Landroid/app/ListActivity;->onDestroy()V

    .line 348
    return-void
.end method

.method protected onListFooterClick()V
    .locals 9

    .prologue
    const/4 v8, 0x0

    const/4 v7, 0x3

    const/4 v6, 0x2

    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 213
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getListView()Landroid/widget/ListView;

    move-result-object v1

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    .line 214
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getListView()Landroid/widget/ListView;

    move-result-object v1

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerViewLoading:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 215
    iget v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->queryLimit:I

    add-int/lit8 v1, v1, 0x14

    iput v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->queryLimit:I

    .line 216
    iget v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    .line 217
    iget-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->query:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, " LIMIT "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget v3, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->queryLimit:I

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/opongo/blogapp/manager/DatabaseManager;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    .line 218
    .local v0, c:Landroid/database/Cursor;
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startManagingCursor(Landroid/database/Cursor;)V

    .line 219
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    iget v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->queryLimit:I

    if-ne v1, v2, :cond_0

    .line 220
    iget-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    invoke-virtual {v1, v0}, Lcom/opongo/android/custom/PostListAdapter;->changeCursor(Landroid/database/Cursor;)V

    .line 221
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getListView()Landroid/widget/ListView;

    move-result-object v1

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerViewLoading:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    .line 222
    invoke-virtual {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->getListView()Landroid/widget/ListView;

    move-result-object v1

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerView:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 223
    iget-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    invoke-virtual {v1}, Lcom/opongo/android/custom/PostListAdapter;->notifyDataSetChanged()V

    .line 224
    new-instance v1, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;

    invoke-direct {v1, p0, v8}, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;)V

    new-array v2, v7, [Ljava/lang/Integer;

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v4

    iget v3, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v5

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v6

    invoke-virtual {v1, v2}, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    move-result-object v1

    iput-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    .line 228
    :goto_0
    return-void

    .line 226
    :cond_0
    new-instance v1, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;

    invoke-direct {v1, p0, v8}, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;-><init>(Lcom/opongo/android/custom/AbstractPostsListActivity;Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;)V

    new-array v2, v7, [Ljava/lang/Integer;

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v4

    iget v3, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->postPage:I

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v5

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v6

    invoke-virtual {v1, v2}, Lcom/opongo/android/custom/AbstractPostsListActivity$downloadOldPostsAsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    move-result-object v1

    iput-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->downloadOld:Landroid/os/AsyncTask;

    goto :goto_0
.end method

.method protected onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V
    .locals 3
    .parameter "l"
    .parameter "v"
    .parameter "position"
    .parameter "id"

    .prologue
    .line 190
    invoke-super/range {p0 .. p5}, Landroid/app/ListActivity;->onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V

    .line 192
    iget-object v1, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->footerViewLoading:Landroid/view/View;

    if-ne p2, v1, :cond_0

    .line 201
    :goto_0
    return-void

    .line 196
    :cond_0
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/opongo/blogapp/activities/PostViewScrollActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 197
    .local v0, intent:Landroid/content/Intent;
    const-string v1, "POSITION"

    invoke-virtual {v0, v1, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 198
    const-string v1, "TABLENAME"

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v2}, Lcom/opongo/blogapp/manager/DatabaseManager;->getTableName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 199
    const-string v1, "QUERY"

    iget-object v2, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->query:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 200
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 3
    .parameter "item"

    .prologue
    const/4 v0, 0x1

    .line 447
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080062

    if-ne v1, v2, :cond_0

    .line 448
    invoke-direct {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->openOptions()V

    .line 463
    :goto_0
    return v0

    .line 450
    :cond_0
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080060

    if-ne v1, v2, :cond_1

    .line 451
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->doRefresh(Z)V

    goto :goto_0

    .line 453
    :cond_1
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080061

    if-ne v1, v2, :cond_2

    .line 454
    invoke-direct {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->openBookmarks()V

    goto :goto_0

    .line 456
    :cond_2
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080063

    if-ne v1, v2, :cond_3

    .line 457
    invoke-direct {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->openCategories()V

    goto :goto_0

    .line 459
    :cond_3
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080064

    if-ne v1, v2, :cond_4

    .line 460
    invoke-direct {p0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->openVoting()V

    goto :goto_0

    .line 463
    :cond_4
    invoke-super {p0, p1}, Landroid/app/ListActivity;->onOptionsItemSelected(Landroid/view/MenuItem;)Z

    move-result v0

    goto :goto_0
.end method

.method public onPause()V
    .locals 0

    .prologue
    .line 377
    invoke-super {p0}, Landroid/app/ListActivity;->onPause()V

    .line 378
    return-void
.end method

.method public onResume()V
    .locals 1

    .prologue
    .line 356
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v0}, Lcom/opongo/blogapp/manager/DatabaseManager;->reopen()V

    .line 357
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->mAdapter:Lcom/opongo/android/custom/PostListAdapter;

    invoke-virtual {v0}, Lcom/opongo/android/custom/PostListAdapter;->getCursor()Landroid/database/Cursor;

    move-result-object v0

    invoke-interface {v0}, Landroid/database/Cursor;->requery()Z

    .line 363
    invoke-super {p0}, Landroid/app/ListActivity;->onResume()V

    .line 365
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->searchString:Ljava/lang/String;

    if-nez v0, :cond_0

    .line 366
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->doRefresh(Z)V

    .line 367
    :cond_0
    return-void
.end method

.method public onSearchRequested()Z
    .locals 2

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 441
    invoke-virtual {p0, v1, v0, v1, v0}, Lcom/opongo/android/custom/AbstractPostsListActivity;->startSearch(Ljava/lang/String;ZLandroid/os/Bundle;Z)V

    .line 442
    const/4 v0, 0x1

    return v0
.end method

.method protected onStart()V
    .locals 0

    .prologue
    .line 432
    invoke-super {p0}, Landroid/app/ListActivity;->onStart()V

    .line 433
    return-void
.end method

.method protected setOpened(II)V
    .locals 1
    .parameter "post_id"
    .parameter "opened"

    .prologue
    .line 204
    iget-object v0, p0, Lcom/opongo/android/custom/AbstractPostsListActivity;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v0, p1, p2}, Lcom/opongo/blogapp/manager/DatabaseManager;->setOpened(II)I

    .line 205
    return-void
.end method

.method public superOnDestroy()V
    .locals 0

    .prologue
    .line 351
    invoke-super {p0}, Landroid/app/ListActivity;->onDestroy()V

    .line 352
    return-void
.end method

.method protected superOnListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V
    .locals 0
    .parameter "l"
    .parameter "v"
    .parameter "position"
    .parameter "id"

    .prologue
    .line 209
    invoke-super/range {p0 .. p5}, Landroid/app/ListActivity;->onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V

    .line 210
    return-void
.end method

.method public superOnResume()V
    .locals 0

    .prologue
    .line 370
    invoke-super {p0}, Landroid/app/ListActivity;->onResume()V

    .line 371
    return-void
.end method

.method protected superOnStart()V
    .locals 0

    .prologue
    .line 436
    invoke-super {p0}, Landroid/app/ListActivity;->onStart()V

    .line 437
    return-void
.end method
